﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyMES.Domain.zmc;
using MyMES.Error;
using MyMES.Read.API.Application.Commends.Proces;

namespace MyMES.Read.API.Controllers.ZMC.Processs
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProcessController : ControllerBase
    {
        private readonly IMediator mediator;

        public ProcessController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 显示工艺路线
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        /// 
        [HttpGet]
        public async Task<APIPaging<List<Process>>> GetProcess([FromQuery] GetProcessCommends request)
        {
            return await mediator.Send(request);
        }
    }
}
